package br.com.agiledev.webscrum.comuns;

import java.util.Comparator;

import br.com.agiledev.webscrum.entity.ItemProduct;

public class ItemProdutComparator implements Comparator<ItemProduct> {
    
    private static ItemProdutComparator instance;

    @Override
    public int compare(ItemProduct o1, ItemProduct o2) {

	// compara os itens
	return ItemComparator.getInstance().compare(o1.getItem(), o2.getItem()) * -1;

    }
    
    public static ItemProdutComparator getInstance() {
	
	if(instance == null) {
	    instance = new ItemProdutComparator();
	}
	
	return instance;
    }
}
